package ch9.ex2;

import static ch9.print.Print.*;

class StringHolder {
	private String data;
	
	StringHolder(String data){
		this.data = data;
	}
	public String toString(){
		return data;
	}
}

public class SequenceOfStringHolder {
	public static void main(String[] args){
		Sequence sequence = new Sequence(10);
		for(int i = 0; i < 10; i++)
		sequence.add(new StringHolder(Integer.toString(i)));
		Selector selector = sequence.selector();
		while(!selector.end()){
			print(selector.current() + " ");
			selector.next();
		}
	}
}
